<script setup lang='ts'>
  import { onMounted, reactive } from 'vue';
  import { equipApi } from '@/api/controller';
  import { Toastloading } from '@/utils/public';
  const action = reactive({
    dialogFormVisible:false,
    list:[] as any[],
    pool_one_list:[] as Array<any>,
  })
  const getList = async(query:any = {})=> {
    const loading = Toastloading()
    const res = await equipApi.statPoolItemDetail({
      ...query
    })
    loading.close()
    const { data=[] } = res.data || {}
    action.list = data
  }
  const openDialog = async(query:any = {})=> {
    const {
     pool_one_id='',date_st='',date_ed=''
    } = query
    await getList({
      pool_one_id,
      date_st,
      date_ed
    })
    action.dialogFormVisible = true
  }
  defineExpose({
    openDialog
  })
</script>

<template>
  <div>
    <el-dialog
    top="5vh"
    class="xm-dialog input-width"
    v-model="action.dialogFormVisible"
    width="55%"
    title="奖励产出详情">
      <el-table
        class="xm-TableCenter"
        :data="action.list"
        border>
        <el-table-column min-width="120" prop="equip_id" label="装备ID" />
        <el-table-column min-width="120" prop="equip_name" label="装备名称" />
        <el-table-column min-width="120" prop="itemNum" label="数量" />
        <el-table-column min-width="120" prop="reward_jd_num" label="产出价值" />
        <el-table-column min-width="120" prop="rate" label="当前概率">
          <template #default="scope">{{ scope.row.rate }}%</template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>